<?php
@session_start();
$loggedInUser = $_SESSION['userId'];
include_once '../class/forum.class.php';
require_once '../class/post.class.php';
$set_thread = new Forum();
$set_thread -> setUserId($loggedInUser);
$set_thread -> setThreadSubject($_POST['it_text_title']);
$set_thread -> setThreadCategory($_POST['it_select_option']);
$threadId = $set_thread -> save();
$post_thread = new Post();
$post_thread -> setUserId($loggedInUser);
$post_thread -> setThreadId($threadId);
$post_thread -> setPost($_POST['it_text_post']);
//$post_thread->setThreadSubject($_POST['it_text_tags']);
$post_thread -> save();
header('Location: thread.php');
?>